package com.freemarker.demo.controller;

import com.freemarker.demo.service.CategoryService;
import com.freemarker.demo.utils.ServerResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @CLASSNAME CategoryController
 * @DESCRIPTION 描述
 * @AUTHOR chen
 * @DATE 2019-03-22 14:37
 **/

@RestController
public class CategoryController {

    @Resource
    private CategoryService categoryService;

    @GetMapping("/all")
    public ServerResponse list(@RequestParam(value = "pn", defaultValue = "1") Integer pn, @RequestParam(value = "pageSize", defaultValue = "3") Integer pageSize) {
        return categoryService.listPage( pn, pageSize );
    }
}
